/*
 * @Description: 农业类型管理
 */
import zhreq from "@/utils/request";
export default {
  /**
   * @description: 获取所有数据项列表 *代表必填
   * @param {String/Number} page
   * @param {String/Number} size
   */
  getDataItemByList(params) {
    return zhreq.get(`v3/iot/iotPlatform/queryRtuByCompanyMark?companyMark=${sessionStorage.organizationNo}`)
  },
  /**
   * @description: 获取列表 *代表必填
   * @param {Object}  *
   */
  datadevicelist(params) {
    return zhreq.post('v3/iot/deviceDataItemMapper/queryPageList', params);
  },
  /**
  * @description: 获取设备摄像头列表 *代表必填
  * @param {Object}  *
  */
  dataCameralist(params) {
    return zhreq.post('v3/iot/deviceCameraMapper/queryPageByCondition', params);
  },
  addCameraList(params) {
    return zhreq.post(`v3/iot/deviceCameraMapper/addList`, params);
  },
  CameraDelList(params) {
    return zhreq.post(`v3/iot/deviceCameraMapper/delList`, params);
  },
  CameraDel(params) {
    return zhreq.get(`v3/iot/deviceCameraMapper/del?deviceCameraMapperId=${params}`);
  },
  /**
   * @description: 获取列表 *代表必填
   * @param {Object}  *
   */
  dataItemlist(params) {
    return zhreq.post('v3/iot/device/queryByCondition', {
      organizationNo: sessionStorage.organizationNo
    });
  },
  getalldataitemselect(params) {
    return zhreq.post('v3/iot/dataItem/queryByCondition', {
      ...(params||{}),
      organizationNo: sessionStorage.organizationNo
    });
  },
  /**
   * @description: 批量拥有摄像头
   * @param {Object}  *
   */
  addlist(params) {
    return zhreq.post('v3/iot/device/bindDataItem', params);
    // return zhreq.post('/base/farmingType/add', params);
  },
  /**
  * @description: 批量拥有摄像头
  * @param {Object}  *
  */
  editFarmingTypelist(params) {
    return zhreq.post('v3/iot/device/edit', params);
    // return zhreq.post('/base/farmingType/add', params);
  },
  /**
   * @description: 批量删除拥有摄像头
   * @param {Object}  *
   */
  delFarmingTypelist(params) {
    return zhreq.get(`v3/iot/deviceDataItemMapper/del/${params}`);
  },
  /**
   * @description: 批量删除拥有摄像头
   * @param {Object}  *
   */
  delListFarmingTypelist(params) {
    return zhreq.post(`v3/iot/deviceDataItemMapper/delList`, params);
  },
  /**
   * @description: 通过农场id查询农场所拥有的农业类型
   * @param {Object}  *
   */
  queryCondFarmingTypelist() {
    return zhreq.post('v3/organization/base/farmingType/queryByCondition', {
      // "companyId": localStorage.companyId
      organizationNo: sessionStorage.organizationNo
    });
  },
  queryLastDataByDeviceNos(params) {
    return zhreq.post(`v3/iot/device/queryLastDataByDeviceNos?organization=${sessionStorage.organizationNo}`, params)
  }
};
